package com.kingsoft.dc.khaos.module.spark.constants

/**
  * Created by haorenhui on 2019/12/04.
  */
object Ks3Constants {

    /**
      * 调度相关配置常量
      */
    final val KS3_BUCKET:String = "ks3.bucket"
    final val KS3_ENDPOINT:String = "ks3.endpoint"
    final val KS3_REGION:String = "ks3.region"
    final val KS3_APPID:String = "ks3.appid"
    final val KS3_AK:String = "ks3.ak"
    final val KS3_SK:String = "ks3.sk"
    final val KS3_WORKDIR:String = "/di/tmp"
    final val KS3_DELIMETER:String = "ks3.delimeter"

    final val KS3_HADOOP_CONFIG_FILE:String = "ks3_hadoop_config.xml"
    final val KS3_CONFIG_FILE:String = "ks3.properties"


    //hadoop config keys
    final val FS_KS3_ACCESSKEY:String = "fs.ks3.AccessKey"
    final val FS_KS3_ACCESSSECRET:String = "fs.ks3.AccessSecret"
    final val FS_KS3_ENDPOINT:String = "fs.ks3.endpoint"
    final val DEFAULT_FS:String = "fs.defaultFS"

    //同步作业常量
    object Ks3CompressionType extends Serializable {
        val none = "none"
        val lzo = "lzo"
    }
    object Ks3ReadPathMode extends Serializable {
        val default = "default"
        val file = "file"
        val folder = "folder"
    }
    object Ks3RegexRangeType extends Serializable {
        val none = "none"
        val time = "time"
    }
    object Ks3RegexRangeTimeRuler extends Serializable {
        val yyyy = "yyyy"
        val yy = "yy"
        val MM = "MM"
        val dd = "dd"
        val HH = "HH"
        val mm = "mm"
        val ss = "ss"
    }

    //正则表达式
    //
    final val dateRegex:String = "\\$\\{bizDate,.*?\\}"
    final val timeRegex:String = "\\$\\{bizTime,.*?\\}"
    final val dateRegex2:String = "\\$\\{bizDate,(?<date>.*?)\\}"
    final val timeRegex2:String = "\\$\\{bizTime,(?<time>.*?)\\}"
    final val dateRegex3:String = "date"
    final val timeRegex3:String = "time"


}
